package system;

import static java.lang.System.out;

import java.rmi.RemoteException;

/**
 *
 * @author Pete Cappello
 */
public class Client
{
    public static void run( Job job, boolean isEc2, int numWorkers ) 
            throws RemoteException
    {
        Cluster cluster = new Cluster();
        ClientToMaster master = cluster.start( isEc2, numWorkers );
        JobRunData jobRunData = master.run( job, isEc2 );
        job.processMasterOutputFile();
        out.print( jobRunData );

        Cluster.stop( isEc2 );
    }
}
